using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using System.Collections;
using System.Collections.Generic;
using BridgeUI;
using BridgeUI.Binding;
using System;

namespace View
{
    public class ListPanel : ListPanelInternal
    {
        private LogicBase logic = new LogicBase();
        private string[] optionStrs = new string[] {
        "Option A",
        "Option B",
        "Option C",
        "Option D",
    };

        private string[] infoStrs = new string[] {
        "直接继承ViewBaseComponent编厚View的脚本",
        "直接继承BindingViewBaseComponent，（分离控件绑定信息，逻辑",
        "使用BindingReference,ViewBase，（分离控件信息,逻辑）",
        "使用BindingReference,BindingViewBase，ViewModel （分离控件信息,绑定信息,逻辑）",
    };
        protected override void OnInitialize()
        {
            base.OnInitialize();
            logic.options = optionStrs;
            logic.ButtonListSelectId = OnButtonListSelectId;
            VM = logic;
        }

        protected void OnButtonListSelectId(IUIPanel panel, int arg0)
        {
            for (int i = 0; i < 10; i++)
            {
                UIFacade.Instence.Open(panel, PanelNames.PopupPanel, new string[] { optionStrs[arg0], infoStrs[arg0]});
            }
        }
    }
}